﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BLL;
using DAL;
using IDAL;
using Model;
namespace Flowers.Controllers
{
    public class CustController : Controller
    {
        BLL.IFactory<ICustomerDal, CustomerDal> bll = new Factory<ICustomerDal, CustomerDal>();
        //
        // GET: /Home/

        public ActionResult CustIndex()
        {
            ViewBag.list = bll.Fbll().CustShow();
            return View();
        }

        /// <summary>
        /// 停用状态
        /// </summary>
        /// <returns></returns>
        public int CustDel()
        {
            int id = Convert.ToInt32(Request["UserID"]);
            if (bll.Fbll().CustDel(id) > 0)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }


        public int CustFull()
        {
            int id = Convert.ToInt32(Request["UserID"]);
            if (bll.Fbll().CustUpt(id) > 0)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
    }
}
